<template>
    <div class="login">
        <el-form ref="form" :model="formInline" label-width="80px">
            <el-form-item label="账号">
                <el-input v-model="formInline.username"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input v-model="formInline.password" type="password"></el-input>
            </el-form-item>
            <el-form-item >
                <el-button type="primary" @click="handleSubmit">登录</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    export default {
        name: 'login',
        data() {
            return {
                formInline: {
                    username: '',
                    password: ''
                },
            }
        },
        methods: {
            handleSubmit() {
                this.Api.login(this.formInline).then((res) => {
                    console.log(res);
                    this.$router.push({
                        name: 'rags_home'
                    })
                })
            }
        },
    }

</script>

<style lang="less" scoped>
    .login {
        margin-top: 250px;
        display: flex;
        justify-content: center;
    }

</style>
